package BIO;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author:谢君臣
 * @Date:2021/7/22-20:49
 * @version:1.0
 * @function:
 */
public class INetAddress_test {

    public static void main(String[] args) throws UnknownHostException {
        InetAddress localhost = InetAddress.getLocalHost(); // 获取本机地址
        System.out.println(localhost.getHostAddress());
        System.out.println(localhost.getHostAddress());
        System.out.println(localhost);
    }

}
